package com.slicktechnologies.server;

import static com.googlecode.objectify.ObjectifyService.ofy;

import java.util.List;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.googlecode.objectify.ObjectifyService;
import com.simplesoftwares.client.library.libservice.RegisterService;
import com.slicktechnologies.shared.Contract;
import com.slicktechnologies.shared.Quotation;
import com.slicktechnologies.shared.ServiceType;
import com.slicktechnologies.shared.common.businessprocesslayer.Customer;
import com.slicktechnologies.shared.common.businessprocesslayer.Expense;
import com.slicktechnologies.shared.common.businessunitlayer.Branch;
import com.slicktechnologies.shared.common.businessunitlayer.Company;
import com.slicktechnologies.shared.common.helperlayer.Config;
import com.slicktechnologies.shared.common.helperlayer.LoggedIn;
import com.slicktechnologies.shared.common.helperlayer.User;
import com.slicktechnologies.shared.common.personlayer.Employee;
import com.slicktechnologies.shared.common.productlayer.Category;
import com.slicktechnologies.shared.common.productlayer.ItemProduct;
import com.slicktechnologies.shared.common.productlayer.ServiceProduct;
import com.slicktechnologies.shared.common.productlayer.SuperProduct;
import com.slicktechnologies.shared.common.relationalLayer.BranchRelation;
import com.slicktechnologies.shared.common.relationalLayer.CustomerRelation;
import com.slicktechnologies.shared.common.relationalLayer.EmployeeRelation;
import com.slicktechnologies.shared.common.relationalLayer.VendorRelation;

public class RegisterServiceImpl extends RemoteServiceServlet implements RegisterService{

/**
	 * 
	 */
	private static final long serialVersionUID = 112247927043018287L;

static{
		
		
		try{
			
			  
			
			 ObjectifyService.register(LoggedIn.class);
			 ObjectifyService.register(ServiceType.class);
			
			
			  ObjectifyService.register(Quotation.class);
			
			  ObjectifyService.register(Contract.class);
		  ObjectifyService.register(Config.class);
		  ObjectifyService.register(Company.class);
		 
		  
		  ObjectifyService.register(Branch.class);
		  ObjectifyService.register(BranchRelation.class);
		  ObjectifyService.register(Employee.class);
		 
		  ObjectifyService.register(EmployeeRelation.class);
		  ObjectifyService.register(User.class);
		  ObjectifyService.register(ItemProduct.class);
		  ObjectifyService.register(SuperProduct.class);
		  ObjectifyService.register(ServiceProduct.class);
		
		  ObjectifyService.register(Expense.class);
		  
		  ObjectifyService.register(Customer.class);
		  ObjectifyService.register(VendorRelation.class);
		  ObjectifyService.register(CustomerRelation.class);
		  ObjectifyService.register(Category.class);
		 
		  
		  

		  
		  ObjectifyService.register(com.slicktechnologies.shared.common.helperlayer.ConfigCategory.class);
		  ObjectifyService.register(com.slicktechnologies.shared.common.helperlayer.Type.class);
		  
		  
		}
		catch(Exception e)
		{
			System.out.println("sumedh");
			e.printStackTrace();
			
		}
	    }
	
	@Override
	public void registerClass() {
		System.out.println("Ajay");
		
		
			
		
	}
	
	public List<Branch> loadAllBranches()
	{
		List<Branch> listOfBranch=ofy().load().type(Branch.class).list();
		
		//MemcacheService memcache=MemcacheService.
		
		return null;
	}
}
